﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel;
using SheepCultivation.API.AddliCation.BeginningW;
using SheepCultivation.API.AddliCation.SheepFile;
using SheepCultivation.Common.Domain.Beginning;
using SheepCultivation.Common.Domain.SheepBasicInformation;
using SheepCultivation.Common.Dto;
using SheepCultivation.Enum;
using System.Globalization;


namespace SheepCultivation.API.Controllers
{
    /// <summary>
    /// 羊只档案控制器
    /// </summary>
    [Route("api/[controller]")]
    [ApiController]
    public class SheepFileController : ControllerBase
    {
        public readonly IMediator mediator;

        public SheepFileController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 羊只档案基本信息表新增
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost("SheepFileAdd")]
        public async Task<Result> Handle(SheepFileCreateCommon request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 耳号下拉框查询
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        /// 
        [HttpPost("BasicInformationList")]
        public async Task<Result> Handle(BasicInformationSeachCommon request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 羊只类型列表显示
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        /// 
        [HttpPost("SheepBeedList")]
        public async Task<Result> Handle(SheepBeedSeachCommon request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 后裔档案新增
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost("ProgeenyFileAdd")]
        public async Task<Result> Handle(ProgenyFileCreateCommon request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 出生状态列表展示
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>

        [HttpPost("BirthStatusList")]
        public async Task<Result> Handle(BirthStatusListCommon request)
        {
           return await mediator.Send(request);
        }
        /// <summary>
        /// 羊只档案列表
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>

        [HttpPost("SheepFileList")]
        public async Task<Result> Handle(SheepFileSeachCommon request)
        {
            return await mediator.Send(request);
        }

        /// <summary>
        /// 种公期初表新增
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost("MalePeriodicAdd")]
        public async Task<Result> Handle(MalePeriodicCreateCommon request)
        {
           
            return  await mediator.Send(request);
        }
        /// <summary>
        /// 种公列表展示
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost("MalePeriodicSeach")]
        public async Task<Result> Handle(MalePeriodicSeachCommon request)
        {
            return await mediator.Send(request);
        }

        /// <summary>
        /// 种母期初新增
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost("FemalePeriodicAdd")]
        public async Task<Result> Handle(FemalePeriodicCreateCommon request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 种母期初列表
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost("FemalePeriodicList")]
        public async Task<Result> Handle(FemalePeriodicSeachCommon request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 后裔期初新增
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost("ProgenyPeriodicAdd")]
        public async Task<Result> Handle(ProgenyPeriodicCreateCommon request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 后裔期初列表展示
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        /// 
        [HttpPost("ProgenyPeriodicList")]
        public async Task<Result> Handle(ProgenyPeriodicSeachCommon request)
        {
          
            return await mediator.Send(request);
        }

        /// <summary>
        /// 羊只档案导入
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost("SheepFileImport")]
        public async Task<Result> Handle(SheepFileImportCommon request)
        {
            
            return await mediator.Send(request);
        }
    }
}
